/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package help;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.net.URL;
import javax.help.HelpBroker;
import javax.help.HelpSet;

/**
 *
 * @author renan_luz
 */
public class Help {
    
    private HelpSet hs;
    private HelpBroker hb;
    
    public Help(){
        //    ClassLoader cl = TestaHelp.class.getClassLoader();
        try {
//            URL hsURL = HelpSet.findHelpSet(cl, helpHS);
            
            //LIXO
            URL hsURL = getClass().getResource("/help/Help.hs");
            
            hs = new HelpSet(null, hsURL);
        } catch (Exception ee) {
            // Say what the exception really is
            System.out.println("HelpSet " + ee.getMessage());
            System.out.println("HelpSet "  + " not found");
            return;
        }
        // Create a HelpBroker object:
        hb = hs.createHelpBroker();
        
//        new CSH.DisplayHelpFromSource(hb);
        //Exibe o help para o usuário com as dimensões totais da tela
        Dimension ds = Toolkit.getDefaultToolkit().getScreenSize();
        hb.setSize(ds);
        hb.setDisplayed(true);
    }
}
